import { http } from "@/utils/http/index.ts";
import type { MappingTypesVo, PageVoChronologicalLedgerVo } from "@/api/models";
import type { ChronologicalLedgerConvert } from "@/api/models";
export interface listQuery {
  /**
   * 页号
   */
  current?: string;
  /**
   * 关键字-摘要
   */
  keyword?: string;
  /**
   * 项目id
   */
  projectId: string;
  /**
   * 页大小
   */
  size?: string;
}
export function list(request: listQuery) {
  return http.get<PageVoChronologicalLedgerVo>("/project/chronological", {
    params: request
  });
}
export function uploadChronological(projectId: string, file: File) {
  let form = new FormData();
  form.append("projectId", projectId);
  form.append("file", file);
  return http.post(
    "/project/chronological/upload",
    { data: form },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
}
export const mappingTypes = (projectId: any) => {
  console.log(projectId);
  return http.get<MappingTypesVo[]>("/project/chronological/mapping-type", {
    params: { projectId }
  });
};
export const standard = (convert: ChronologicalLedgerConvert) => {
  return http.post("/project/chronological/standard", { data: convert });
};
